//
//  XYButton.m
//  TheDragon
//
//  Created by wingfac on 2017/8/2.
//  Copyright © 2017年 LJ. All rights reserved.
//

#import "XYButton.h"

@implementation XYButton
{
    UIImageView * imageView;
}
- (void)setMyButtonIcon:(NSString *)imageName titleTest:(NSString *)title titleColor:(UIColor *)color
{
    
    imageView = [[UIImageView alloc]initWithFrame:CGRectMake((self.frame.size.width - 20)/2, 10, 20, 20)];
    imageView.image = [UIImage imageNamed:imageName];
    [self addSubview:imageView];
    
    _buttonTitle = [[UILabel alloc]initWithFrame:CGRectMake(0, 35, self.frame.size.width, 10)];
    _buttonTitle.text = title;
    _buttonTitle.textAlignment = NSTextAlignmentCenter;
    _buttonTitle.font = [UIFont systemFontOfSize:12];
    _buttonTitle.textColor = color;
    [self addSubview:_buttonTitle];
    
    
}
- (void)clean{
    imageView.image = nil;
    _buttonTitle.text = nil;
}
@end
